package com.centit.framework.ip.businessdata.po;

import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;


/**
 * create by scaffold 2018-05-22
 *
 * @author guo_jh
 * <p>
 * T_INTERFACE_METHOD业务系统方法配置信息表
 */
@Entity
@Table(name = "T_INTERFACE_METHOD")
public class InterfaceMethod implements java.io.Serializable {
    private static final long serialVersionUID = 1L;


    /**
     * YWID 业务主键
     */
    @Id
    @Column(name = "YWID")

    private String ywid;

    /**
     * RECORDID 接口信息表主键
     */
    @Column(name = "RECORDID")
    @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
    private String recordid;
    /**
     * METHODFLAG 方法路径标识
     */
    @Column(name = "METHODFLAG")
    @Length(min = 0, max = 200, message = "字段长度不能小于{min}大于{max}")
    private String methodflag;
    /**
     * METHODURL 方法路径
     */
    @Column(name = "METHODURL")
    @Length(min = 0, max = 2000, message = "字段长度不能小于{min}大于{max}")
    private String methodurl;
    /**
     * METHODCOMMECT 方法说明
     */
    @Column(name = "METHODCOMMECT")
    @Length(min = 0, max = 2000, message = "字段长度不能小于{min}大于{max}")
    private String methodcommect;
    /**
     * SQLCONTENT sql语句主体
     */
    @Column(name = "SQLCONTENT")
    private String sqlcontent;
    /**
     * START_OR_STOP 启用/禁用
     */
    @Column(name = "START_OR_STOP")
    @Length(min = 0, max = 4, message = "字段长度不能小于{min}大于{max}")
    private String startOrStop;
    /**
     * CREATER 创建人
     */
    @Column(name = "CREATER")
    @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
    private String creater;
    /**
     * CREATE_TIME 创建时间
     */
    @Column(name = "CREATE_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mi:ss")
    private Date createTime;
    /**
     * UPDATER 更新人
     */
    @Column(name = "UPDATER")
    @Length(min = 0, max = 32, message = "字段长度不能小于{min}大于{max}")
    private String updater;
    /**
     * UPDATE_TIME 更新时间
     */
    @Column(name = "UPDATE_TIME")
    private Date updateTime;

    // Constructors

    /**
     * default constructor
     */
    public InterfaceMethod() {
    }

    /**
     * minimal constructor
     */
    public InterfaceMethod(
            String ywid
    ) {


        this.ywid = ywid;

    }

    /**
     * full constructor
     */
    public InterfaceMethod(
            String ywid
            , String recordid, String methodflag, String methodurl, String methodcommect, String sqlcontent, String startOrStop, String creater, Date createTime, String updater, Date updateTime) {


        this.ywid = ywid;

        this.recordid = recordid;
        this.methodflag = methodflag;
        this.methodurl = methodurl;
        this.methodcommect = methodcommect;
        this.sqlcontent = sqlcontent;
        this.startOrStop = startOrStop;
        this.creater = creater;
        this.createTime = createTime;
        this.updater = updater;
        this.updateTime = updateTime;
    }


    public String getYwid() {
        return this.ywid;
    }

    public void setYwid(String ywid) {
        this.ywid = ywid;
    }
    // Property accessors

    public String getRecordid() {
        return this.recordid;
    }

    public void setRecordid(String recordid) {
        this.recordid = recordid;
    }

    public String getMethodflag() {
        return this.methodflag;
    }

    public void setMethodflag(String methodflag) {
        this.methodflag = methodflag;
    }

    public String getMethodurl() {
        return this.methodurl;
    }

    public void setMethodurl(String methodurl) {
        this.methodurl = methodurl;
    }

    public String getMethodcommect() {
        return this.methodcommect;
    }

    public void setMethodcommect(String methodcommect) {
        this.methodcommect = methodcommect;
    }

    public String getSqlcontent() {
        return this.sqlcontent;
    }

    public void setSqlcontent(String sqlcontent) {
        this.sqlcontent = sqlcontent;
    }

    public String getStartOrStop() {
        return this.startOrStop;
    }

    public void setStartOrStop(String startOrStop) {
        this.startOrStop = startOrStop;
    }

    public String getCreater() {
        return this.creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdater() {
        return this.updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    public Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


    public InterfaceMethod copy(InterfaceMethod other) {

        this.setYwid(other.getYwid());

        this.recordid = other.getRecordid();
        this.methodflag = other.getMethodflag();
        this.methodurl = other.getMethodurl();
        this.methodcommect = other.getMethodcommect();
        this.sqlcontent = other.getSqlcontent();
        this.startOrStop = other.getStartOrStop();
        this.creater = other.getCreater();
        this.createTime = other.getCreateTime();
        this.updater = other.getUpdater();
        this.updateTime = other.getUpdateTime();

        return this;
    }

    public InterfaceMethod copyNotNullProperty(InterfaceMethod other) {

        if (other.getYwid() != null) {
            this.setYwid(other.getYwid());
        }

        if (other.getRecordid() != null) {
            this.recordid = other.getRecordid();
        }
        if (other.getMethodflag() != null) {
            this.methodflag = other.getMethodflag();
        }
        if (other.getMethodurl() != null) {
            this.methodurl = other.getMethodurl();
        }
        if (other.getMethodcommect() != null) {
            this.methodcommect = other.getMethodcommect();
        }
        if (other.getSqlcontent() != null) {
            this.sqlcontent = other.getSqlcontent();
        }
        if (other.getStartOrStop() != null) {
            this.startOrStop = other.getStartOrStop();
        }
        if (other.getCreater() != null) {
            this.creater = other.getCreater();
        }
        if (other.getCreateTime() != null) {
            this.createTime = other.getCreateTime();
        }
        if (other.getUpdater() != null) {
            this.updater = other.getUpdater();
        }
        if (other.getUpdateTime() != null) {
            this.updateTime = other.getUpdateTime();
        }

        return this;
    }

    public InterfaceMethod clearProperties() {

        this.recordid = null;
        this.methodflag = null;
        this.methodurl = null;
        this.methodcommect = null;
        this.sqlcontent = null;
        this.startOrStop = null;
        this.creater = null;
        this.createTime = null;
        this.updater = null;
        this.updateTime = null;

        return this;
    }
}
